<?$fecha = date("d")."-".date("m")."-".date("Y");
include ("../conectarse.php");




$documento = $_POST['nrodoc'];

$consulta = "select * from solicitantes where sol_nro_doc like $documento";
$resultado = mysql_query($consulta);
$fila = mysql_fetch_array($resultado);
$solicitante = $fila[0];
$apellido = $fila['sol_nombre'];
$nombre = $fila['sol_apellido'];
$tipodoc = $fila['sol_tipo_doc'];
$nrodoc = $fila['sol_nro_doc'];
$cuil = $fila['sol_cuil'];
$civil = $fila['sol_civil'];
$carpetanombre = $_POST['carpetanombre'];

$sexo  = $fila['sol_sexo'];
$apellidomaterno = $fila['sol_apellido_materno'];
$nacionalidad = $fila['sol_nacionalidad'];
$calle = $fila['sol_calle'];
$altura = $fila['sol_altura'];
$departamento = $fila['sol_departamento'];
$piso = $fila['sol_piso'];
$localidad = $fila['sol_localidad'];
$provincia = $fila['sol_provincia'];
$partido = $fila['sol_partido'];
$telefono = $fila['sol_telefono'];
$celular = $fila['sol_celular'];
$codigopostal = $fila['sol_codigo_postal'];
$reparticion = $fila['sol_reparticion'];
$lugartrabajo = $fila['sol_lugar_trabajo'];
$domiciliolaboral = $fila['sol_domicilio_laboral'];
$localidadlaboral = $fila['sol_localidad2'];
$telefonolaboral = $fila['sol_telefono2'];
$interno = $fila['sol_interno'];
$codigopostal2 = $fila['sol_codigo_postal_2'];
$apellidoreferencia  = $fila['sol_referencia_apellido'];
$nombrereferencia = $fila['sol_referencia_nombre'];
$vinculoreferencia = $fila['sol_vinculo'];
$fijoreferencia = $fila['sol_referencia_telefono'];
$nacdia = substr($fila['sol_nacimiento'],6,2);
$nacmes = substr($fila['sol_nacimiento'],4,2);
$nacano = substr($fila['sol_nacimiento'],0,4);
$importe = $_POST['importe'];
$cuotas = $_POST['cuotas'];
$interes = $_POST['interes'];
$interestipo = $_POST['interestipo'];

$fechaprestamo = date("Y").date("m").date("d").date("h").date("i");
$inserta = "INSERT INTO `wi530914_mutuar`.`prestamos` (
`pres_id` ,
`pres_id_mutual` ,
`pres_id_solicitante` ,
`pres_id_dueno` ,
`pres_importe` ,
`pres_cuotas` ,
`pres_interes` ,
`pres_interes_tipo` ,
`pres_fecha_alta` ,
`pres_estado` ,
`pres_nombre`
)
VALUES (
NULL , '1', '$solicitante', '0', '$importe', '$cuotas', '$interes', '$interestipo', '$fechaprestamo', '1', '$carpetanombre'
);";
$insertar = mysql_query($inserta);


?>
<body bgcolor = "#005F8C" alink = "white" vlink = "white" link = "white" text = "white">
<table width  ="100%" height = "100%" cellpadding = "0" cellspacing = "0">

<tr valign = "top">

<td align = "center">

<!--BARRA                    -->

<?include ("./barra/barramutual.php");?>

<!-- FIN DE LA BARRA                    -->
</td>


</tr>


<tr valign = "top" height = "100%"><td align = "left">

<!-- CUERPO DEL SISTEMA -->
<table cellpadding = "0" cellspacing = "0" border  ="0" height = "100%">
<tr valign = "middle"><td bgcolor = "black">


<?include ("links.php");?>



<!-- FIN DEL CUERPO DEL SISTEMA -->








</td><form method = "POST"><td width = "100%" ALIGN = "CENTER"><br>

<table height = "100%"><TR valign="top"><TD>
<table border ="2" cellspacing = "0" cellpadding = "0" bordercolor = "white">
<tr><td>




        <table><tr><td colspan  ="4"></td></tr>

  <tr><td colspan  = "4" align="center"><b>SOLICITANTE</td></tr>
  
  <tr><td colspan  = "4"><hr></td></tr>
        <tr>
        <td>Nombre:</td>
        <td><input type = "text" name = "nombre" value = "<?echo $nombre;?>" disabled="disabled"></td>
        <td>Apellido:</td>
        <td><input type = "text" name = "apellido" value = "<?echo $apellido;?>" disabled="disabled"></td>
        </tr>


        <tr>
        <td>Nacimiento:</td>
        <td>
<select name = "nacdia" disabled="disabled">
<?for($i=1;$i<32;$i++){?>

<option value = "<?if(strlen($i)=="1"){echo "0".$i;}else{echo $i;}?>" <?if($nacdia==$i){echo "selected";}?>><?if(strlen($i)=="1"){echo "0".$i;}else{echo $i;}?></option>
<?}?>
</select>
<select name = "nacmes" disabled="disabled">
<?for($i=1;$i<13;$i++){?>

<option value = "<?if(strlen($i)=="1"){echo "0".$i;}else{echo $i;}?>" <?if($nacmes==$i){echo "selected";}?>><?if(strlen($i)=="1"){echo "0".$i;}else{echo $i;}?></option>
<?}?>
</select>
<select name = "nacano" disabled="disabled">
<?for($i=1900;$i<2011;$i++){?>

<option value = "<?if(strlen($i)=="1"){echo "0".$i;}else{echo $i;}?>" <?if($nacano==$i){echo "selected";}?>><?if(strlen($i)=="1"){echo "0".$i;}else{echo $i;}?></option>
<?}?>
</select>


</td>
        <td>Tipo y Nro de Documento:</td>
        <td><input type = "text" name = "tipodoc" size="2" value = "<?echo $tipodoc;?>" disabled="disabled"><input type = "text" name = "nrodoc" size = "16" value = "<?echo $nrodoc;?>" disabled="disabled"></td>
        </tr>
<tr><TD>Cuil</TD><TD><input type = "text" name = "cuil" value = "<?echo $cuil;?>" disabled="disabled"></TD></tr>
        <tr>
        <td>Estado Civil:</td>
        <td>
<select name = "civil" disabled="disabled">
<option value = "0" <?if($civil=="0"){echo "selected";}?>>Soltero/a</option>

<option value = "1" <?if($civil=="1"){echo "selected";}?>>Casado/a</option>

<option value = "2" <?if($civil=="2"){echo "selected";}?>>Divorciado/a</option>

<option value = "3" <?if($civil=="3"){echo "selected";}?>>Viudo/a</option>
</select>

</td>
        <td>Sexo:</td>
        <td>
<select name = "sexo" disabled="disabled">
<option value = "0" <?if($sexo=="0"){echo "selected";}?>>Masculino</option>

<option value = "1" <?if($sexo=="1"){echo "selected";}?>>Femenino</option>

</select>


</td>
        </tr>


        <tr>
        <td>Apellido Materno:</td>
        <td><input type = "text" name = "apellidomaterno" value = "<?echo $apellidomaterno;?>" disabled="disabled"></td>
        <td>Nacionalidad:</td>
        <td><input type = "text" name = "nacionalidad" value = "<?echo $nacionalidad;?>" disabled="disabled"></td>
        </tr>


                <tr><td colspan  ="4"><hr></td></tr>

 <tr>
        <td>Provincia:</td>
        <td>

<select name = "provincia" onchange="this.form.submit()" disabled="disabled">

<option = ""></option>


<?$busquedaprov = "select * from provincias order by nombre Asc";
$resultadoprov = mysql_query($busquedaprov);
while($filaprov=mysql_fetch_array($resultadoprov)){?>


<option value = "<?echo $filaprov['0']?>" <?if($filaprov['0']==$provincia){echo "selected";}?>><?echo $filaprov['nombre']?></option>

<?}?>

</select>


</td>
        <td>Partido:</td>
        <td>

<select name = "partido" onchange="this.form.submit()" disabled="disabled">

<option = ""></option>


<?$busquedapar = "select * from departamentos where provincia_id = $provincia order by nombre Asc";
$resultadopar = mysql_query($busquedapar);
while($filapar=mysql_fetch_array($resultadopar)){?>


<option value = "<?echo $filapar['0']?>" <?if($filapar['0']==$partido){echo "selected";}?>><?echo $filapar['nombre']?></option>

<?}?>

</select>

</td>
        </tr>

  <tr>
        <td>Localidad:</td>
        <td>




<select name = "localidad" onchange="this.form.submit()" disabled="disabled">

<option = ""></option>


<?$busquedalocal = "select * from localidades where departamento_id = $partido order by nombre Asc";
$resultadolocal = mysql_query($busquedalocal);
while($filalocal=mysql_fetch_array($resultadolocal)){?>


<option value = "<?echo $filalocal['0']?>" <?if($filalocal['0']==$localidad){echo "selected";}?>><?echo $filalocal['nombre']?></option>

<?}?>

</select>





</td>
        <td>Calle:</td>
        <td><input type = "text" name = "calle" value = "<?echo $calle;?>" disabled="disabled"></td>
        </tr>

         <tr>
        <td>Altura:</td>
        <td><input type = "text" name = "altura" value = "<?echo $altura;?>" disabled="disabled"></td>
        <td>Piso:</td>
        <td><input type = "text" name = "piso" value = "<?echo $piso;?>" disabled="disabled"></td>
        </tr>


        <tr>
        <td>Dto:</td>
        <td><input type = "text" name = "departamento" value = "<?echo $departamento;?>" disabled="disabled"></td>
        <td>Codigo Postal:</td>
        <td><input type = "text" name = "codigopostal" value = "<?echo $codigopostal;?>" disabled="disabled"></td>
        </tr>

 <tr>
        <td>Telefono:</td>
        <td><input type = "text" name = "telefono" value = "<?echo $telefono;?>" disabled="disabled"></td>
        <td>Celular:</td>
        <td><input type = "text" name = "celular" value = "<?echo $celular;?>" disabled="disabled"></td>
        </tr>

  <tr><td colspan  = "4"><hr></td></tr>
  
  <tr><td colspan  = "4" align="center"><b>DATOS LABORALES</td></tr>
  
  <tr><td colspan  = "4"><hr></td></tr>
  
   <tr>
        <td>Reparticion:</td>
        <td><input type = "text" name = "reparticion" value = "<?echo $reparticion;?>" disabled="disabled"></td>
        <td>Lugar de trabajo:</td>
        <td><input type = "text" name = "lugartrabajo" value = "<?echo $lugartrabajo;?>" disabled="disabled"></td>
        </tr>

         <tr>
        <td>Domicilio Laboral:</td>
        <td><input type = "text" name = "domiciliolaboral" value = "<?echo $domiciliolaboral;?>" disabled="disabled"></td>
        <td>Localidad:</td>
        <td><input type = "text" name = "localidadlaboral" value = "<?echo $localidadlaboral;?>" disabled="disabled"></td>
        </tr>

         <tr>
        <td>Tel Laboral:</td>
        <td><input type = "text" name = "telefonolaboral" value = "<?echo $telefonolaboral;?>" disabled="disabled"></td>
        <td>Interno:</td>
        <td><input type = "text" name = "interno" value = "<?echo $interno;?>" disabled="disabled"></td>
        </tr>

         <tr>
        <td>Codigo Postal:</td>
        <td><input type = "text" name = "codigopostal2" value = "<?echo $codigopostal2?>" disabled="disabled"></td>
        </tr>

  <tr><td colspan  = "4"><hr></td></tr>
  
  <tr><td colspan  = "4" align="center"><b>REFERENCIA</td></tr>
  
  <tr><td colspan  = "4"><hr></td></tr>
  
   <tr>
        <td>Ref. Nombre:</td>
        <td><input type = "text" name = "nombrereferencia" value = "<?echo $nombrereferencia;?>" disabled="disabled"></td>
        <td>Ref. Apellido:</td>
        <td><input type = "text" name = "apellidoreferencia" value = "<?echo $apellidoreferencia;?>" disabled="disabled"></td>
        </tr>

         <tr>
        <td>Ref Vinculo:</td>
        <td><input type = "text" name = "vinculoreferencia" value = "<?echo $vinculoreferencia;?>" disabled="disabled"></td>
        <td>Ref Fijo:</td>
        <td><input type = "text" name = "fijoreferencia" value = "<?echo $fijoreferencia;?>" disabled="disabled"></td>
        </tr>

  <tr><td colspan  = "4"><hr></td></tr>

<tr><td colspan  = "4" align="center"><b>DETALLES</td></tr>
  
  <tr><td colspan  = "4"><hr></td></tr>
  
   <tr>
        <td>Importe x cuota:</td>
        <td> $<input type = "text" name = "importe" value = "<?echo $importe;?>"  size="19" disabled="disabled"></td>
        <td>Cuotas:</td>
        <td><input type = "text" name = "interes1"  value = "<?echo $cuotas;?>" disabled="disabled"></td>
        </tr>


  <tr><td colspan  = "4"><hr></td></tr>







<input type = "hidden" name = "nombre" value = "<?echo $nombre;?>">
<input type = "hidden" name = "apellido" value = "<?echo $apellido;?>">
<input type = "hidden" name = "nacdia" value = "<?echo $nacdia;?>">
<input type = "hidden" name = "nacmes" value = "<?echo $nacmes;?>">
<input type = "hidden" name = "nacano" value = "<?echo $nacano;?>">
<input type = "hidden" name = "tipodoc" value = "<?echo $tipodoc;?>">
<input type = "hidden" name = "nrodoc" value = "<?echo $nrodoc;?>">
<input type = "hidden" name = "cuil" value = "<?echo $cuil;?>">
<input type = "hidden" name = "civil" value = "<?echo $civil;?>">
<input type = "hidden" name = "sexo" value = "<?echo $sexo;?>">
<input type = "hidden" name = "apellidomaterno" value = "<?echo $apellidomaterno;?>">
<input type = "hidden" name = "nacionalidad" value = "<?echo $nacionalidad;?>">
<input type = "hidden" name = "provincia" value = "<?echo $provincia;?>">
<input type = "hidden" name = "partido" value = "<?echo $partido;?>">
<input type = "hidden" name = "localidad" value = "<?echo $localidad;?>">
<input type = "hidden" name = "calle" value = "<?echo $calle;?>">
<input type = "hidden" name = "altura" value = "<?echo $altura;?>">
<input type = "hidden" name = "piso" value = "<?echo $piso;?>">
<input type = "hidden" name = "departamento" value = "<?echo $departamento;?>">
<input type = "hidden" name = "codigopostal" value = "<?echo $codigopostal;?>">
<input type = "hidden" name = "telefono" value = "<?echo $telefono;?>">
<input type = "hidden" name = "celular" value = "<?echo $celular;?>">
<input type = "hidden" name = "reparticion" value = "<?echo $reparticion;?>">
<input type = "hidden" name = "lugartrabajo" value = "<?echo $lugartrabajo;?>">
<input type = "hidden" name = "domiciliolaboral" value = "<?echo $domiciliolaboral;?>">
<input type = "hidden" name = "localidadlaboral" value = "<?echo $localidadlaboral;?>">
<input type = "hidden" name = "telefonolaboral" value = "<?echo $telefonolaboral;?>">
<input type = "hidden" name = "interno" value = "<?echo $interno;?>">
<input type = "hidden" name = "codigopostal2" value = "<?echo $codigopostal2;?>">
<input type = "hidden" name = "nombrereferencia" value = "<?echo $nombrereferencia;?>">
<input type = "hidden" name = "apellidoreferencia" value = "<?echo $apellidoreferencia;?>">
<input type = "hidden" name = "vinculoreferencia" value = "<?echo $vinculoreferencia;?>">
<input type = "hidden" name = "fijoreferencia" value = "<?echo $fijoreferencia;?>">






</form><form action  = "index.php" method = "POST">
  <tr>
  <TD COLSPAN = "4" ALIGN = "CENTER"><input type = "submit" value = "Cerrar"></td></tr>









</form></tr></table>












</TD></TR></table>




















</td></tr></table>




























</td>
</td></tr>

</table>
